﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SE560Multimedia.src;

namespace SE560Multimedia.pages
{
    public partial class MainPage : System.Web.UI.MasterPage
    {        
        SessionManager sessionManager;

        protected void Page_Load(object sender, EventArgs e)
        {
            sessionManager = new SessionManager(Session);
            LabelUsername.Text = "Welcome! " + sessionManager.SessionLoggedUserName;
        }

        protected void LogOutButton_Click(object sender, EventArgs e)
        {
            Session.Clear();
            System.Web.HttpContext.Current.Response.Redirect(SessionManager.LOGIN_PAGE_ADDRESS);
        }

        protected void PreferencesButton_Click(object sender, EventArgs e)
        {
            System.Web.HttpContext.Current.Response.Redirect(SessionManager.USER_PREFERENCES_PAGE_ADDESS);
        }
    }
}
